<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/jquery.min.js"></script>
	</head>
	<body>
		<h3>多选框，全选或全取消</h3>
		<div id="">			
			<input type="checkbox" name="hobby" id="hobby" value="乒乓球" />乒乓球
			<input type="checkbox" name="hobby" id="hobby" value="象棋" />象棋
			<input type="checkbox" name="hobby" id="hobby" value="荡秋千" />荡秋千
			<div class="">
				<button id="selectAll">全选</button>
				<button id="unselectAll">取消</button>
				<button id="reselect">反选</button>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		$("#selectAll").click(function(){
			$("[id=hobby]").prop("checked",true);
		})
		$("#unselectAll").click(function(){
			$("[id=hobby]").attr("checked",false);
		})
		// $("#reselect").click(function(){
		// 	$("[id=hobby]"attr("checked",)
		// })
	</script>
</html>
